package net.lovesrc.support.service.generator.idcard;

/**
 * 身份证信息
 * @author gelic
 * Created in 20:30 2018/10/29
 * @since
 */
public class IDCard {
    /**
     * 姓名
     */
    private String name;
    /**
     * 身份证号
     */
    private String no;
    /**
     * 性别
     */
    private String gender;
    /**
     * 地址
     */
    private String addr;

    public IDCard() {
    }

    public IDCard(String name, String no, String gender, String addr) {
        this.name = name;
        this.no = no;
        this.gender = gender;
        this.addr = addr;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getAddr() {
        return addr;
    }

    public void setAddr(String addr) {
        this.addr = addr;
    }

    @Override
    public String toString() {
        return "IDCard:{name: " + name + ", no: " + no + ", gender: " + gender + ", addr: " + addr + "}";
    }

    @Override
    public int hashCode() {
        return no == null ? 17 : no.hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        if(obj instanceof IDCard) {
            IDCard idCard = (IDCard) obj;
            return no.equals(idCard.getNo());
        }
        return false;
    }
}
